package com.jk.smartelderlycare.controller;

import com.jk.smartelderlycare.dto.SysLabel;
import com.jk.smartelderlycare.dto.SysTution;
import com.jk.smartelderlycare.interfaces.SysTutionServiceApi;
import com.jk.smartelderlycare.pojo.PagedResponse;
import com.jk.smartelderlycare.service.SysTutionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hhk
 * @version 1.0
 * @ClassName SysTutionController
 * @program: smart-elderly-care
 * @description: TODO
 * @date 2024/11/13 19:31
 */
@Slf4j
@RestController
public class SysTutionController implements SysTutionServiceApi {

    @Autowired
    private SysTutionService sysTutionService;
    /**
     * @description: 机构列表后端分页查询
     * @param: [sysTution, pageNum, pageSize]
     * @return: com.jk.smartelderlycare.pojo.PagedResponse<com.jk.smartelderlycare.dto.SysTution>
     * @author hhk
     * @date: 2024/11/13 19:32
     */
    @Override
    public PagedResponse<SysTution> findSysTutionPagimationList(SysTution sysTution, Integer pageNum, Integer pageSize) {
        return sysTutionService.findSysTutionPagimationList(sysTution,pageNum,pageSize);
    }
    /**
     * @description: 新增
     * @param: [sysTution]
     * @return: void
     * @author hhk
     * @date: 2024/11/13 20:25
     */
    @Override
    public void addSysTution(SysTution sysTution) {
        sysTutionService.addSysTution(sysTution);
    }
    /**
     * @description: 根据id删除一条数据
     * @param: [tutionId]
     * @return: void
     * @author hhk
     * @date: 2024/11/13 20:25
     */
    @Override
    public void deleteSysTutionByTutionId(Long tutionId) {
        sysTutionService.deleteSysTutionByTutionId(tutionId);
    }
    /**
     * @description: 根据id回显一条数据
     * @param: [tutionId]
     * @return: com.jk.smartelderlycare.dto.SysTution
     * @author hhk
     * @date: 2024/11/13 20:25
     */
    @Override
    public SysTution findSysTutionByTutionId(Long tutionId) {
        return sysTutionService.findSysTutionByTutionId(tutionId);
    }
    /**
     * @description: 修改数据
     * @param: [sysTution]
     * @return: void
     * @author hhk
     * @date: 2024/11/13 20:26
     */
    @Override
    public void updataSysTution(SysTution sysTution) {
        sysTutionService.updataSysTution(sysTution);
    }
    /**
     * @description: 标签下拉列表从
     * @param: []
     * @return: java.util.List<com.jk.smartelderlycare.dto.SysLabel>
     * @author hhk
     * @date: 2024/11/13 20:26
     */
    @Override
    public List<SysLabel> findSysLabelList() {
        return sysTutionService.findSysLabelList();
    }
}
